package com.ehome.poct.core.api.dto.common;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author gyl
 * @since 2022/3/5 14:32
 **/
@Getter
public enum DeviceCheckStatusEnum {
    WAIT(0, "待检测"),
    IN_PROGRESS(5, "进行中"),
    FINISH(10, "已完成");
    private final int type;
    private final String desc;

    DeviceCheckStatusEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static DeviceCheckStatusEnum getByType(int type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }
}
